package com.ruoyi.project.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.system.mapper.SysUserMoneyMapper;
import com.ruoyi.project.system.domain.SysUserMoney;
import com.ruoyi.project.system.service.ISysUserMoneyService;

/**
 * 用户余额明细Service业务层处理
 * 
 * @author jjp
 * @date 2020-04-26
 */
@Service
public class SysUserMoneyServiceImpl implements ISysUserMoneyService 
{
    @Autowired
    private SysUserMoneyMapper sysUserMoneyMapper;

    /**
     * 查询用户余额明细
     * 
     * @param moneyId 用户余额明细ID
     * @return 用户余额明细
     */
    @Override
    public SysUserMoney selectSysUserMoneyById(Long moneyId)
    {
        return sysUserMoneyMapper.selectSysUserMoneyById(moneyId);
    }

    /**
     * 查询用户余额明细列表
     * 
     * @param sysUserMoney 用户余额明细
     * @return 用户余额明细
     */
    @Override
    public List<SysUserMoney> selectSysUserMoneyList(SysUserMoney sysUserMoney)
    {
        return sysUserMoneyMapper.selectSysUserMoneyList(sysUserMoney);
    }

    /**
     * 新增用户余额明细
     * 
     * @param sysUserMoney 用户余额明细
     * @return 结果
     */
    @Override
    public int insertSysUserMoney(SysUserMoney sysUserMoney)
    {
        sysUserMoney.setCreateTime(DateUtils.getNowDate());
        return sysUserMoneyMapper.insertSysUserMoney(sysUserMoney);
    }

    /**
     * 修改用户余额明细
     * 
     * @param sysUserMoney 用户余额明细
     * @return 结果
     */
    @Override
    public int updateSysUserMoney(SysUserMoney sysUserMoney)
    {
        return sysUserMoneyMapper.updateSysUserMoney(sysUserMoney);
    }

    /**
     * 批量删除用户余额明细
     * 
     * @param moneyIds 需要删除的用户余额明细ID
     * @return 结果
     */
    @Override
    public int deleteSysUserMoneyByIds(Long[] moneyIds)
    {
        return sysUserMoneyMapper.deleteSysUserMoneyByIds(moneyIds);
    }

    /**
     * 删除用户余额明细信息
     * 
     * @param moneyId 用户余额明细ID
     * @return 结果
     */
    @Override
    public int deleteSysUserMoneyById(Long moneyId)
    {
        return sysUserMoneyMapper.deleteSysUserMoneyById(moneyId);
    }
}
